#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
#  debugger.py
#  
#  Copyright 2012 Facundo Acevedo <Acv2Facundo<en>Gmail.com>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#  
#  



import logging

logging.basicConfig(level=logging.DEBUG, filename='debug.log',
                    format='%(asctime)s %(levelname)s: %(message)s',
                    datefmt='%H:%M:%S')
def mensaje(clase, texto,nombre_funcion):
    """Recibe texto o lista"""
    if type(texto) == list:
        for strings in texto:
            if type(strings) == str:
                mensaje = clase+"-"+nombre_funcion+">: "+strings
                logging.debug(mensaje)
            else:
                try:
                    mensaje = clase+"-"+nombre_funcion+">: "+strings.__name__ #para funciones o que se yo
                    logging.debug(mensaje)
                except:
                    pass
    else:
        if type(texto) == str:
            mensaje = clase+"-"+nombre_funcion+">: "+texto
            logging.debug(mensaje)
        else:
            try:
                mensaje = clase+"-"+nombre_funcion+">: "+strings.__name__ #para funciones o que se yo
                logging.debug(mensaje)
            except:
                pass



